home *** CD-ROM | disk | FTP | other *** search
/ Chip 2002 February / CHIPCD_02_2002.iso / Internet / Macromedia ColdFusion Server 5 / coldfusion-50-win-us.exe / data1.cab / Examples / CFDOCS / snippets / arrayisempty.cfm < prev    next >
Encoding:
Text File  |  2001-06-13  |  838 b   |  31 lines

  1. <!--- This example shows ArrayIsEmpty --->
  2. <HTML>
  3. <HEAD>
  4. <TITLE>ArrayIsEmpty Example</TITLE>
  5. </HEAD>
  6.  
  7. <BASEFONT FACE="Arial, Helvetica" SIZE=2>
  8. <BODY  bgcolor="#FFFFD5">
  9.  
  10. <H3>ArrayIsEmpty Example</H3>
  11. <!--- create a new array --->
  12. <CFSET MyArray = ArrayNew(1)>
  13. <!--- populate an element or two --->
  14. <CFSET MyArray[1] = "Test">
  15. <CFSET MyArray[2] = "Other Test">
  16. <!--- output the contents of the array --->
  17. <P>Your array contents are:
  18. <CFOUTPUT>#ArrayToList(MyArray)#</CFOUTPUT>
  19. <!--- check if the array is empty --->
  20. <P>Is the array empty?:
  21. <CFOUTPUT>#ArrayIsEmpty(MyArray)#</CFOUTPUT>
  22. <P>Now, clear the array:
  23. <!--- now clear the array --->
  24. <CFSET Temp = ArrayClear(MyArray)>
  25. <!--- check if the array is empty --->
  26. <P>Is the array empty?:
  27. <CFOUTPUT>#ArrayIsEmpty(MyArray)#</CFOUTPUT>
  28.  
  29. </BODY>
  30. </HTML>       
  31.